/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package sp.panelcomponent;

import javax.swing.JTable;
import javax.swing.table.TableColumn;
import sp.errorpage.ErrorManager;

/**
 *
 * @author Tiara Ratna Dewi [12.7403]
 */
public class ErrorTable extends javax.swing.JPanel {
    public ErrorManager error;
    /**
     * Creates new form testTabel
     */
    @SuppressWarnings("empty-statement")
    /**
     * Creates new form ErrorTable
     */
    public ErrorTable() {
        initComponents();
//        error=new ErrorManager();
//        tabelError.setModel(error.getError());
        SetLebarKolom();
    }
    
    public void SetLebarKolom(){ 
        TableColumn column;
        this.tabelError.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); 
        int x = this.tabelError.getWidth();
        column = this.tabelError.getColumnModel().getColumn(0); 
        column.setPreferredWidth(50);
        column = this.tabelError.getColumnModel().getColumn(1); 
        column.setPreferredWidth(120); 
        column = this.tabelError.getColumnModel().getColumn(2); 
        column.setPreferredWidth(50); 
    }

    public JTable getTabelError() {
        return tabelError;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane2 = new javax.swing.JScrollPane();
        tabelError = new javax.swing.JTable();

        setMaximumSize(new java.awt.Dimension(100, 32767));
        setMinimumSize(new java.awt.Dimension(100, 0));

        sp.model.TableErrorModel model = new sp.model.TableErrorModel();
        tabelError.setModel(model);
        jScrollPane2.setViewportView(tabelError);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTable tabelError;
    // End of variables declaration//GEN-END:variables
}
